package models

import "time"

// AnalysisStatus represents the status of AI analysis
type AnalysisStatus string

const (
	AnalysisStatusPending   AnalysisStatus = "pending"
	AnalysisStatusAnalyzing AnalysisStatus = "analyzing"
	AnalysisStatusCompleted AnalysisStatus = "completed"
	AnalysisStatusFailed    AnalysisStatus = "failed"
)

// TicketAnalysis represents AI analysis for a ticket
type TicketAnalysis struct {
	ID          string         `json:"id" bson:"_id"`
	TicketID    string         `json:"ticketId" bson:"ticketId"`
	Status      AnalysisStatus `json:"status" bson:"status"`
	RootCause   string         `json:"rootCause,omitempty" bson:"rootCause,omitempty"`
	Solution    string         `json:"solution,omitempty" bson:"solution,omitempty"`
	Prevention  string         `json:"prevention,omitempty" bson:"prevention,omitempty"`
	ErrorMsg    string         `json:"errorMsg,omitempty" bson:"errorMsg,omitempty"`
	CreatedAt   time.Time      `json:"createdAt" bson:"createdAt"`
	UpdatedAt   time.Time      `json:"updatedAt" bson:"updatedAt"`
	CompletedAt *time.Time     `json:"completedAt,omitempty" bson:"completedAt,omitempty"`
}
